<template>
  <div class="app-container">
    <div>
      <ListPage
        :data="listData"
        :option="option"
        @search-change="handleSearchChange"
        @page-change="handlePageChange"
        @row-link="handleRowLink"
        @row-save="handleRowSave"
        @row-update="handleRowUpdate"
        @row-del="handleRowDel"
        @sort-change="handleSortChange"
      >
        <template slot="button" slot-scope="{ row }">
          <el-button
            type="primary"
            icon="el-icon-info"
            size="small"
            @click="handleOutView(row)"
          >
            扩展按钮
          </el-button>
        </template>
      </ListPage>
    </div>
  </div>
</template>

<script>
import ListPage from '@/components2/ListPage'
import ListMixin from '@/components2/ListPage/ListMixin'
import ResPartner from '@/odooapi/models/res.partner'

export default {
  name: 'Dashboard',
  components: { ListPage },
  mixins: [ResPartner, ListMixin],
  data() {
    return {
      viewPath: 'test-detail',
      optionForList: {
        handleBtn: {
          // label: '操作',
          viewBtn: true,
          width: 400
        }
      }
    }
  },
  computed: {},
  async created() {
    console.log('xxx, create')
    // const me = this.$store.state.appMe
    // console.log('xxx, create 1', me)
    // // const me2 = await this.$store.dispatch('appMe/getInfo')
    // const me3 = this.$store.state.appMe
    // // console.log('xxx, create 2', me2)
    // console.log('xxx, create 3', me3)

    this.flashData()
    this.flashCount()
  },

  mounted() {},
  methods: {
    async handleOutView(row) {
      this.$message({
        type: 'success',
        message: JSON.stringify(row)
      })
    }
  }
}
</script>
<style></style>
